package com.jming.jike.dto.backend;

import com.jming.jike.common.ValidatorGroup.Update;
import com.jming.jike.dto.BaseDTO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * @author jinming.zhang
 * @version 0.0.1
 * @date 2022/04/25
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class UpdatePasswordDTO extends BaseDTO {

    @ApiModelProperty("当前员工的id")
    @NotNull(message = "员工id不能为空", groups = {Update.class})
    private Long id;

    @ApiModelProperty("原密码")
    @NotBlank(message = "原密码不能为空", groups = {Update.class})
    private String oldPassword;

    @ApiModelProperty("新密码")
    @NotBlank(message = "新密码不能为空", groups = {Update.class})
    @Pattern(regexp = "^[a-zA-Z]\\w{5,17}$", message = "密码格式不正确!", groups = {Update.class})
    private String password;

    @ApiModelProperty("确认密码 与新密码相同")
    @NotBlank(message = "确认密码不能为空", groups = {Update.class})
    private String surePassword;

}
